var t = require;
var e = module;
var o = exports;
var i, n = this && this.__extends || (i = function(t, e) {
    return (i = Object.setPrototypeOf || {
        __proto__: []
    }
    instanceof Array &&
    function(t, e) {
        t.__proto__ = e
    } ||
    function(t, e) {
        for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o])
    })(t, e)
},
function(t, e) {
    function o() {
        this.constructor = t
    }
    i(t, e),
    t.prototype = null === e ? Object.create(e) : (o.prototype = e.prototype, new o)
}),
a = this && this.__decorate ||
function(t, e, o, i) {
    var n, a = arguments.length,
    r = a < 3 ? e: null === i ? i = Object.getOwnPropertyDescriptor(e, o) : i;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(t, e, o, i);
    else for (var s = t.length - 1; s >= 0; s--)(n = t[s]) && (r = (a < 3 ? n(r) : a > 3 ? n(e, o, r) : n(e, o)) || r);
    return a > 3 && r && Object.defineProperty(e, o, r),
    r
};
Object.defineProperty(o, "__esModule", {
    value: !0
});
var r, s = cc._decorator,
l = s.ccclass,
c = s.property; (function(t) {
    t[t.Default = 0] = "Default",
    t[t.FullScene = 1] = "FullScene",
    t[t.MaxScale = 2] = "MaxScale",
    t[t.MinScale = 3] = "MinScale",
    t[t.Notch = 4] = "Notch"
})(r || (r = {}));
var d = function(t) {
    function e() {
        var e = null !== t && t.apply(this, arguments) || this;
        return e.adapType = r.Default,
        e
    }
    return n(e, t),
    e.prototype.onLoad = function() {
        switch (this.adapType) {
            case r.FullScene:
                this.onFullScene();
            break;
            case r.MaxScale:
                this.onMaxScale();
            break;
            case r.Notch:
                this.onNotch();
            break;
            default:
                this.onMaxScale();
        }
    },
    e.prototype.onFullScene = function() {
        this.node.width = cc.winSize.width,
        this.node.height = cc.winSize.height
    },
    e.prototype.onMaxScale = function() {
        var t = cc.view.getFrameSize(),
        e = t.width / t.height,
        o = cc.view.getDesignResolutionSize(),
        i = e / (o.width / o.height);
        this.node.scale = i
    },
    e.prototype.onMinScale = function() {},
    e.prototype.onNotch = function() {
        var t = cc.view.getFrameSize(),
        e = t.width / t.height,
        o = cc.view.getDesignResolutionSize();
        e > o.width / o.height && e > 2 && (this.node.width = cc.winSize.width - e / 2 * 100, this.node.height = cc.winSize.height)
    },
    e.prototype.onBackground = function() {
        var t = cc.view.getFrameSize(),
        e = t.width / t.height,
        o = cc.view.getDesignResolutionSize(),
        i = e / (o.width / o.height);
        this.node.scale = i
    },
    a([c({
        type: cc.Enum(r),
        visible: !0
    })], e.prototype, "adapType", void 0),
    a([l], e)
} (cc.Component);
o.default = d